import 'package:flutter_jd/pages/setting/controller.dart';
import 'package:flutter_jd/service/global_service.dart';
import 'package:flutter_jd/ui/widgets/dialog/aniation_dialog.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/route_manager.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

// 退出登录按钮
class OutButton extends GetWidget<SettingController> {
  @override
  Widget build(BuildContext context) {
    GlobalConfigService globalService = Get.find();

    return Obx(
      () => Offstage(
        offstage: !globalService.isLogin.value,
        child: GestureDetector(
          onTap: () {
            controller.showDialog(TransitionType.scale, context);
          },
          child: Container(
            width: double.infinity,
            height: 50.h,
            alignment: Alignment.center,
            margin: EdgeInsets.only(top: 12.h),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(15.r),
            ),
            child: Text(
              '退出登录',
              style: TextStyle(fontSize: 16.sp),
            ),
          ),
        ),
      ),
    );
  }
}
